<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: fzh
  Date: 2017/9/16
  Time: 13:56
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>${dept.deptName} - 管理端</title>
    <link rel="stylesheet" href="http://code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css">
    <link href="http://maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
    <style type="text/css">
        * {
            margin: 0;
            padding: 0;
            -webkit-box-sizing: border-box;
            -moz-box-sizing: border-box;
            box-sizing: border-box;
        }

        html, body {
            width: 100%;
            /*height: 100%;*/
            background-color: #F7F7F7;
        }

        @media screen and (max-width: 1080px) {
            body {
                width: 1080px;
            }
        }

        /**
        * 内容
        -----------------------------*/
        .content {
            display: flex;
            justify-content: space-between;
            width: 100%;
            padding-top: 20px;
            padding-bottom: 40px;
        }
        /**
        * 左侧菜单 content-left
        * 右侧内容 content-right
        -----------------------------*/
        .content-left,
        .content-right{
            display: flex;
        }


        .content-left {
            justify-content: flex-end;
            padding-top: 20px;
            width: 12%;
            height: calc(100% - 80px);
        }
        .content-right {
            width: 85%;
            padding-right: 40px;

        }
        ul {
            list-style-type: none;
            padding: 0;
            margin: 0;
        }

        a {
            color: #b63b4d;
            text-decoration: none;
        }

        /**
        * accordion
        -----------------------------*/
        .accordion {
            width: 100%;
            max-width: 360px;
            background: #FFF;
            -webkit-border-radius: 4px;
            -moz-border-radius: 4px;
            border-radius: 4px;
        }

        .accordion .link {
            cursor: pointer;
            display: block;
            padding: 15px 15px 15px 42px;
            color: #4D4D4D;
            font-size: 14px;
            font-weight: 700;
            border-bottom: 1px solid #CCC;
            position: relative;
            -webkit-transition: all 0.4s ease;
            -o-transition: all 0.4s ease;
            transition: all 0.4s ease;
        }

        .accordion li:last-child .link {
            border-bottom: 0;
        }

        .accordion li i {
            position: absolute;
            top: 16px;
            left: 12px;
            font-size: 18px;
            color: #595959;
            -webkit-transition: all 0.4s ease;
            -o-transition: all 0.4s ease;
            transition: all 0.4s ease;
        }

        .accordion li i.fa-chevron-down {
            right: 12px;
            left: auto;
            font-size: 16px;
        }

        .accordion li.open .link,
        .accordion li.open i {
            color: #b63b4d;
        }

        .accordion li.open i.fa-chevron-down {
            -webkit-transform: rotate(180deg);
            -ms-transform: rotate(180deg);
            -o-transform: rotate(180deg);
            transform: rotate(180deg);
        }

        /**
        * Submenu
        -----------------------------*/
        .submenu {
            display: none;
            background: #444359;
            font-size: 14px;
        }

        .submenu li {
            border-bottom: 1px solid #4b4a5e;
        }

        .submenu a {
            display: block;
            text-decoration: none;
            color: #d9d9d9;
            padding: 12px;
            padding-left: 42px;
            -webkit-transition: all 0.25s ease;
            -o-transition: all 0.25s ease;
            transition: all 0.25s ease;
        }

        .submenu a:hover {
            background: #b63b4d;
            color: #FFF;
        }

        /**
        * Right Pane
        -----------------------------*/
    </style>
</head>
<body>
<%--页头--%>
<jsp:include page="../components/adminHeader.jsp">
    <jsp:param name="adminId" value="${sessionScope.admin.adminId }"/>
    <jsp:param name="adminName" value="${sessionScope.admin.name }"/>
    <jsp:param name="deptCode" value="${sessionScope.dept.deptCode }"/>
    <jsp:param name="deptName" value="${sessionScope.dept.deptName }"/>
</jsp:include>
<div class="content">
    <%--菜单--%>
    <div class="content-left">
        <ul id="accordion" class="accordion">
            <li>
                <div class="link">
                    <i class="ion-flag"></i>指南管理<i class="fa fa-chevron-down"></i>
                </div>
                <ul class="submenu">
                    <li><a href="<c:url value="/admin/guide/manage?option=add"/>">增加指南</a></li>
                    <li><a href="<c:url value="/admin/guide/manage?option=all&start=1"/>">查看全部</a></li>
                </ul>
            </li>
            <li>
                <div class="link">
                    <i class="fa fa-paint-brush"></i>个人审批<i class="fa fa-chevron-down"></i>
                </div>
                <ul class="submenu">
                    <li><a href="<c:url value="/admin/person/manage?option=new&start=1"/>">新的申请</a></li>
                    <li><a href="<c:url value="/admin/person/manage?option=all&start=1"/>">查看全部</a></li>
                </ul>
            </li>
            <li>
                <div class="link">
                    <i class="fa fa-money"></i>企业审批<i class="fa fa-chevron-down"></i>
                </div>
                <ul class="submenu">
                    <li><a href="<c:url value="/admin/enterprise/manage?option=new&start=1"/>">新的申请</a></li>
                    <li><a href="<c:url value="/admin/enterprise/manage?option=all&start=1"/>">查看全部</a></li>
                </ul>
            </li>
            <li>
                <div class="link">
                    <i class="ion-person"></i>个人中心<i class="fa fa-chevron-down"></i>
                </div>
                <ul class="submenu">
                    <li><a href="<c:url value="/admin/logout"/>">退出系统</a></li>
                </ul>
            </li>
        </ul>
    </div>
    <%--内容面板--%>
    <div class="content-right">
        <c:choose>
            <c:when test="${requestScope.start == null}">
                <jsp:include page="/admin/pane">
                    <jsp:param name="submenu" value="${requestScope.submenu}"/>
                </jsp:include>
            </c:when>
            <c:otherwise>
                <jsp:include page="/admin/pane">
                    <jsp:param name="submenu" value="${requestScope.submenu}"/>
                    <jsp:param name="start" value="${requestScope.start}"/>
                </jsp:include>
            </c:otherwise>
        </c:choose>
    </div>
</div>
<script src='/assets/js/jquery-3.2.1.min.js'></script>
<script type="text/javascript">
    $(function () {
        let Accordion = function (el, multiple) {
            this.el = el || {};
            this.multiple = multiple || false;
            let links = this.el.find('.link');
            links.on('click', {el: this.el, multiple: this.multiple}, this.dropdown)
        };
        Accordion.prototype.dropdown = function (e) {
            let $el = e.data.el;
            $this = $(this);
            $next = $this.next();
            $next.slideToggle();
            $this.parent().toggleClass('open');
            if (!e.data.multiple) {
                $el.find('.submenu').not($next).slideUp().parent().removeClass('open');
            }
        };
        let accordion = new Accordion($('#accordion'), false);
    });
</script>
</body>
</html>
